package com.tomdd.mapper;

import com.tomdd.model.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author zhongxu
 * @description 针对表【user(用户表)】的数据库操作Mapper
 * @createDate 2024-07-17 21:27:40
 * @Entity com.tomdd.model.entity.User
 */
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据用户ID更新密码
     *
     * @param newPwd md5加密后的密码
     * @param id     用户ID；
     */
    @Update("update user set password=#{newPwd},update_time=now() where id=#{id}")
    void updatePwd(@Param("newPwd") String newPwd, @Param("id") Integer id);


}




